package org.xqyy.eval.model;

import tk.mybatis.mapper.annotation.KeySql;
import tk.mybatis.mapper.code.ORDER;

import javax.persistence.*;
import java.util.List;

@Table(name = "t_dept")
public class TDept {
    @Id
    @KeySql(sql = "select uuid()", order = ORDER.BEFORE)
    private String id;

    private String code;

    private String name;

    private String leader;

    private String status;

    private String pcode;

    @Column(name = "group_code")
    private String groupCode;

    @Transient
    private TDeptGroup deptGroup;

    public TTestPaper gettTestPaper() {
        return tTestPaper;
    }

    public void settTestPaper(TTestPaper tTestPaper) {
        this.tTestPaper = tTestPaper;
    }

    public List<TQuestion> gettQuestions() {
        return tQuestions;
    }

    public void settQuestions(List<TQuestion> tQuestions) {
        this.tQuestions = tQuestions;
    }

    @Transient
    private TTestPaper tTestPaper;

    @Transient
    private List<TQuestion> tQuestions;

    public TDeptGroup getDeptGroup() {
        return deptGroup;
    }

    public void setDeptGroup(TDeptGroup deptGroup) {
        this.deptGroup = deptGroup;
    }



    @Transient
    private String groupName;

    public String getGroupName() {
        if (deptGroup == null){
            return "";
        }
        return deptGroup.getName();
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }
    /**
     * @return id
     */
    public String getId() {
        return id;
    }

    /**
     * @param id
     */
    public void setId(String id) {
        this.id = id;
    }

    /**
     * @return code
     */
    public String getCode() {
        return code;
    }

    /**
     * @param code
     */
    public void setCode(String code) {
        this.code = code;
    }

    /**
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return leader
     */
    public String getLeader() {
        return leader;
    }

    /**
     * @param leader
     */
    public void setLeader(String leader) {
        this.leader = leader;
    }

    /**
     * @return status
     */
    public String getStatus() {
        return status;
    }

    /**
     * @param status
     */
    public void setStatus(String status) {
        this.status = status;
    }

    /**
     * @return pcode
     */
    public String getPcode() {
        return pcode;
    }

    /**
     * @param pcode
     */
    public void setPcode(String pcode) {
        this.pcode = pcode;
    }

    /**
     * @return group_code
     */
    public String getGroupCode() {
        return groupCode;
    }

    /**
     * @param groupCode
     */
    public void setGroupCode(String groupCode) {
        this.groupCode = groupCode;
    }
}